<template>
	<view class="content">
		<workcard :data="cardDetail" :noMargin="true"/>
	</view>
</template>

<script>
	import workcard from '@/components/workcard/index.vue'
	export default {
		components: {
			workcard
		},
		data() {
			return {
				id: '',
				cardDetail: {},
				bid: ''
			}
		},
		onLoad: function(e) {
			let ctid = e.ctid || ''
			if (ctid) {
				uni.setStorageSync('ctid', ctid);
			}
			this.id = e.id
			this.bid = e.bid
			this.getCertificate()
		},
		methods: {
			getCertificate() {
				let param = {
					id: parseInt(this.id) || 0,
					bid: this.bid
				}
				this.$HTTP.post('/work_permit_card/cert_info', param, true).then((res) => {
					this.cardDetail = res.data
				}).catch(err => {
				
				})  
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f8f8f8;
	}
</style>